const prefix = '/api';
const suffix = '.do';

const urlMap = {
   'dev': {
		'登录': '/sign',
		'退出登录': '/signout',
		'生成图形验证码唯一id': '/generateImageVerifyCodeId',
		'生成图形验证码': '/generateImageVerifyCode',
		'发送邮箱验证码': '/sendCodeOfEmail',
		'注册': '/signup',
		'检查邮箱是否重复': '/checkEmail',
		'检查登录账号是否重复': '/checkLoginId',
		'旅游产品列表': '/travelProductList',
		'获取对应产品的网站地址': '/thirdPartyDomainOfAgent',
		'导游详情': '/travelGuide',
		'导游产品详情': '/travelGuideFromTravelProduct',
		'用户关注导游接口': '/userFollowGuide',
		'旅游社详情': '/travelAgencyFromTravelProduct',
		'通过旅行社编号调用旅游社详情': '/travelAgency',
		'创建旅游订单': '/createTravelOrder',
		'支付旅游订单': '/payTravelOrder',
		'取消旅游订单': '/cancelTravelOrder',
		'旅游订单列表': '/travelOrderList',
		'旅游订单详情': '/travelOrder',
		'用户详情': '/userDetail',
		'获取余额和提现费率': '/userBalance',
        '用户请求提币': '/requestWithdrawing',
        '修改登录密码': '/updateLoginPw',
        '修改支付密码': '/updateTradePw',
        '忘记密码': '/updateLoginPwNotLogin',
        '是否设置用户交易密码': '/isTradePw',
        '用户交易记录列表': '/userFundRecordListByUser',
        '判断是否为平台内或外': '/checkIfInnerAddress',
        '旅行社关注': '/userFollowAgency',
        '用户关注旅行社列表': '/userFollowAgencyList',
        '用户关注导游列表': '/userFollowGuideList',
        '点击预约计数': '/makeAppointmentLog',
   }
};

export const urlService = (type: string, key: string) => {
   const url = urlMap[type][key];
   if (url) {
		return prefix + urlMap[type][key] + suffix;
   } else {
		throw Error(`fail to find url: ${key}`);
   }
};

